<?php
class halo_HandlerExecutionChain {
    protected $handler;
    protected $interceptors;
    public function __construct($handler, $interceptors = null) {
        if ( $interceptors == null ) { $interceptors = array(); }
        if ( ! is_array($interceptors) ) { $interceptors = array($interceptors); }
        if ( $handler instanceof halo_HandlerExecutionChain ) {
            $this->handler = $handler->getHandler();
            $this->interceptors = array_merge($handler->getInterceptors(), $interceptors);
        } else {
            $this->handler = $handler;
            $this->interceptors = $interceptors;
        }
    }
    public function getHandler() {
        return $this->handler;
    }
    public function getInterceptors() {
        return $this->interceptors;
    }
}
?>
